/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sbbs.springboot.sample7;

import java.util.Map;
import static org.springframework.core.convert.TypeDescriptor.map;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 *
 * @author Administrator
 */
@Controller
public class TemplateController {

//    /**
//     * 返回html模板.
//     */
//    @RequestMapping("/index")
//    public String indexHtml(Map<String, Object> map) {
//        return "/index";
//    }
//    @RequestMapping("/index_v1")
//    public String indexv1(Map<String, Object> map) {
//        return "/index_v1";
//    }
    /**
     * 返回html模板.
     */
    @RequestMapping("/{mapping}")
    public String helloHtml(@PathVariable String mapping) {
//        map.put("hello", "from TemplateController.helloHtml");
        return "/"+mapping;
    }

    /**
     * 返回html模板.
     */
    @RequestMapping("/helloFtl")
    public String helloFtl(Map<String, Object> map) {
        map.put("hello", "from TemplateController.helloFtl");
        return "/helloFtl";
    }
}
